﻿#region using statements

using System;

using Microsoft.Xna.Framework;

using NGen.Managers.GUI;

using Nuclex.UserInterface;
using Nuclex.UserInterface.Controls;

#endregion

namespace XNAGameDemo.GUI
{
	public class GUIElementCreditsState : GUIElement
	{
		private readonly LabelControl m_label = new LabelControl();

		private readonly WindowWithOkButtonControl m_window = new WindowWithOkButtonControl();

		protected override void _Initialize() {
			m_window.Bounds = new UniRectangle(new UniScalar(0.5f, -250.0f), new UniScalar(0.25f, 0.0f), 500, 500);
			m_window.OkButton.Pressed += _OkButtonClick;

			m_label.Bounds = new UniRectangle(new UniScalar(0.05f, 0.0f), new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), new UniScalar(0.2f, 0.0f));
			m_label.Text = "This demo was created for the CMPS 327 class " + "at ULL.\n\n It uses the Microsoft XNA Framework version 4.0," + "the Nuclex\nframework for XNA 4.0, and the XNA Game Engine " + "developed\nby Brandon Primeaux. This demo is intended to " + "acquaint\nstudents with the engine and give example code " + "showing how\nto use the different components.";

			m_window.Children.Add(m_label);

			_Children.Add(m_window);
		}

		protected override void Update(GameTime p_gameTime) {}

		protected override void _Cleanup() {}

		protected virtual void _OkButtonClick(object p_sender, EventArgs p_e) {
			_Children.Remove(m_window);
			m_window.Close();
		}
	}
}